package com.cmpe451.nutty.apiresponses;

/**
 * @author      CmpE Group 2 Fall 2014 nuttyconfirmation@gmail.com
 * @version     2.0
 * @since       06.01.2015
 */

public class JsonError {
	public int code;
	public String msg;
	
	
	public JsonError errorCreater(int code){
		JsonError err = new JsonError();
		err.code = code;
		switch(code){
		case -1:
			err.msg= "Unkown error";
		break;
		
		case 0:
			err.msg = "User already exists";
		break;
		
		case 1:
			err.msg = "User already logged in";
		break;
			
		case 2:
			err.msg = "User not logged in";
		break;
		
		case 3:
			err.msg = "Username password mismatch";
		break;
		
		case 4:
			err.msg = "Username does not exist";
		break;
		
		case 5:
			err.msg = "Email already associated with an account";
		break;
		
		case 6:
			err.msg = "Recipe not found";
		break;
		
		case 7:
			err.msg = "Not following this user";
		break;
		
		case 8:
			err.msg = "User ID not found";
		break;
		
		case 9:
			err.msg = "User already rated!";
		break;
		
		case 10:
			err.msg = "User already favorited this recipe";
		break;
		
		default:
			err.msg = "Undefined error message";
		break;
		
		}
		return err;
	}
	
}